home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03010102.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  3.8 KB  |  62 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>MsgBox Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03010102"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         p.P1{
  5.                 }
  6.         p.P2{
  7.                 }
  8.         span.T1{
  9.                 font-weight:bold;}
  10.         </style></head><body>
  11.   
  12.   
  13.   <help:to-be-embedded Eid="msgbox" xmlns:help="http://openoffice.org/2000/help">
  14.   <p class="Head1"><help:link Id="66524">MsgBox Function [Runtime]</help:link></p>
  15.   <p class="Paragraph">Displays a dialog box containing a message. This function allows you to define a button used to confirm the dialog.</p>
  16.   </help:to-be-embedded>
  17.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  18.   <p class="Paragraph">MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) <help:key-word value="MsgBox" tag="kw66524_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  19.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  20.   <p class="Paragraph">Integer</p>
  21.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  22.   <p class="Paragraph">Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13). Only the first 255 characters of a string are displayed; all remaining characters are disregarded.</p>
  23.   <p class="Paragraph">DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed.</p>
  24.   <p class="Paragraph">Type: Any integer expression that specifies the dialog type and defines the number and type of butons or icons displayed. <span class="T1">Type</span> represents a combination of bit patterns, i.e., dialog elements can be defined by adding the respective values:</p>
  25.   <p class="P2">Values</p>
  26.   <p class="Paragraph">0 : Display OK button only.</p>
  27.   <p class="Paragraph">1 : Display OK and Cancel buttons.</p>
  28.   <p class="Paragraph">2 : Display Cancel and Retry buttons.</p>
  29.   <p class="Paragraph">3 : Display Yes, No, and Cancel buttons.</p>
  30.   <p class="Paragraph">4 : Display Yes and No buttons.</p>
  31.   <p class="Paragraph">5 : Display Retry and Cancel buttons.</p>
  32.   <p class="Paragraph">16 : Add the Stop icon to the dialog.</p>
  33.   <p class="Paragraph">32 : Add the Question icon to the dialog.</p>
  34.   <p class="Paragraph">48 : Add the Explanation icon to the dialog.</p>
  35.   <p class="Paragraph">64 : Add the Information icon to the dialog.</p>
  36.   <p class="Paragraph">0 : First button in the dialog as default button.</p>
  37.   <p class="Paragraph">256 : Second button in the dialog as default button.</p>
  38.   <p class="Paragraph">512 : Third button in the dialog as default button.</p>
  39.   <p class="P2">Return value:</p>
  40.   <p class="Paragraph">1 : OK</p>
  41.   <p class="Paragraph">2 : Cancel</p>
  42.   <p class="Paragraph">4 : Retry</p>
  43.   <p class="Paragraph">5 : Ignore</p>
  44.   <p class="Paragraph">6 : Yes</p>
  45.   <p class="Paragraph">7 : No</p>
  46.   <p class="Paragraph">The MsgBox function returns a value indicating which button the user has chosen. The following return values are possible:</p>
  47.   <p class="P2">Return value</p>
  48.   <p class="Paragraph">1 : OK</p>
  49.   <p class="Paragraph">2 : Cancel</p>
  50.   <p class="Paragraph">4 : Retry</p>
  51.   <p class="Paragraph">5 : Ignore</p>
  52.   <p class="Paragraph">6 : Yes</p>
  53.   <p class="Paragraph">7 : No</p>
  54.   <p class="P2">Example:</p>
  55.   <p class="PropText">Sub ExampleMsgBox</p>
  56.   <p class="PropText">Dim sVar as Integer</p>
  57.   <p class="PropText">sVar = MsgBox("Las Vegas")</p>
  58.   <p class="PropText">sVar = MsgBox("Las Vegas",1)</p>
  59.   <p class="PropText">sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title")</p>
  60.   <p class="PropText">end sub</p>
  61.   <p class="PropText"/>
  62.  </body></html>